<template>
  <div class="container">
    <div class="m-b-20">
      <el-select v-model="brandName" size="small" @change="changeBrandName"
                 filterable placeholder="请选择车辆">
        <el-option
            v-for="item in brandNameList"
            :key="item"
            :label="item"
            :value="item">
        </el-option>
      </el-select>
    </div>
    <div v-loading="fullscreenLoading" element-loading-text="正在分析数据...请勿重复刷新哦~"
         ref="chart" class="chart"></div>
  </div>
</template>

<script>
import * as echarts from 'echarts'
import 'echarts/extension/bmap/bmap'
import dataApi from "@/api/dataApi";

export default {
  name: "View4",
  data() {
    return {
      brandName: "",
      brandNameList: [],
      fullscreenLoading: false
    }
  },
  mounted() {
    this.getBrandNameList()
  },
  methods: {
    changeBrandName(val) {
      this.brandName = val
      this.getData()
    },
    getBrandNameList() {
      dataApi.getSeriesNameList().then(resp => {
        this.brandNameList = resp.data;
        this.brandName = this.brandNameList[0]
        this.getData()
      })
    },
    getData() {
      this.fullscreenLoading = true;
      dataApi.getSeriesNameCity(this.brandName).then(resp => {
        const data = resp.data
        const myChart = echarts.init(this.$refs.chart)
        const geoCoordMap = {
          '北京': [116.40529, 39.904987],
          '天津': [117.190186, 39.125595],
          '石家庄': [114.502464, 38.045475],
          '晋州': [115.04488, 38.027477],
          '新乐': [114.68578, 38.34477],
          '唐山': [118.17539, 39.635113],
          '遵化': [117.96587, 40.188618],
          '迁安': [118.701935, 40.012108],
          '秦皇岛': [119.58658, 39.94253],
          '邯郸': [114.490685, 36.612274],
          '武安': [114.19458, 36.696114],
          '邢台': [114.50885, 37.0682],
          '南宫': [115.3981, 37.35967],
          '沙河': [114.504906, 36.861904],
          '保定': [115.48233, 38.867657],
          '涿州': [115.97341, 39.485764],
          '安国': [115.33141, 38.421368],
          '高碑店': [115.882706, 39.32769],
          '张家口': [114.884094, 40.8119],
          '承德': [117.939156, 40.976204],
          '沧州': [116.85746, 38.31058],
          '泊头': [116.57016, 38.07348],
          '任丘': [116.106766, 38.706512],
          '黄骅': [117.3438, 38.36924],
          '河间': [116.089455, 38.44149],
          '廊坊': [116.70444, 39.523926],
          '霸州': [116.39202, 39.117332],
          '三河': [117.07702, 39.982777],
          '衡水': [115.66599, 37.735096],
          '深州': [115.554596, 38.00347],
          '太原': [112.54925, 37.857014],
          '古交': [112.174355, 37.908535],
          '大同': [113.29526, 40.09031],
          '阳泉': [113.58328, 37.861187],
          '长治': [113.113556, 36.191113],
          '潞城': [113.22324, 36.332233],
          '晋城': [112.85127, 35.497555],
          '高平': [112.930695, 35.791355],
          '朔州': [112.43339, 39.33126],
          '晋中': [112.736465, 37.696495],
          '介休': [111.91386, 37.027615],
          '运城': [111.00396, 35.022778],
          '永济': [110.44798, 34.865124],
          '河津': [110.710266, 35.59715],
          '忻州': [112.733536, 38.41769],
          '原平': [112.713135, 38.729187],
          '临汾': [111.517975, 36.08415],
          '侯马': [111.37127, 35.6203],
          '霍州': [111.72311, 36.57202],
          '吕梁': [111.13434, 37.524364],
          '孝义': [111.78157, 37.144474],
          '汾阳': [111.78527, 37.267742],
          '呼和浩特': [111.6708, 40.81831],
          '包头': [109.84041, 40.65817],
          '乌海': [106.82556, 39.673733],
          '赤峰': [118.9568, 42.27532],
          '通辽': [122.26312, 43.617428],
          '霍林郭勒': [119.65786, 45.53236],
          '鄂尔多斯': [109.99029, 39.81718],
          '呼伦贝尔': [119.75817, 49.215332],
          '满洲里': [117.45556, 49.59079],
          '牙克石': [120.729004, 49.287025],
          '扎兰屯': [122.7444, 48.007412],
          '额尔古纳': [120.178635, 50.2439],
          '根河': [121.53272, 50.780453],
          '巴彦淖尔': [107.41696, 40.7574],
          '乌兰察布': [113.11454, 41.034126],
          '丰镇': [113.16346, 40.437534],
          '乌兰浩特': [122.06898, 46.077236],
          '阿尔山': [119.94366, 47.177],
          '二连浩特': [111.97981, 43.652897],
          '锡林浩特': [116.0919, 43.9443],
          '沈阳': [123.42909, 41.79677],
          '新民': [122.828865, 41.99651],
          '大连': [121.61862, 38.91459],
          '瓦房店': [122.002655, 39.63065],
          '庄河': [122.97061, 39.69829],
          '鞍山': [122.99563, 41.110626],
          '海城': [122.7522, 40.85253],
          '抚顺': [123.92111, 41.875957],
          '本溪': [123.770515, 41.29791],
          '丹东': [124.38304, 40.124294],
          '东港': [124.14944, 39.88347],
          '凤城': [124.07107, 40.457565],
          '锦州': [121.13574, 41.11927],
          '凌海': [121.364235, 41.171738],
          '北镇': [121.79596, 41.598763],
          '营口': [122.23515, 40.66743],
          '盖州': [122.35554, 40.405235],
          '大石桥': [122.5059, 40.633972],
          '阜新': [121.648964, 42.011795],
          '辽阳': [123.18152, 41.2694],
          '灯塔': [123.32587, 41.427837],
          '盘锦': [122.06957, 41.124485],
          '铁岭': [123.84428, 42.290585],
          '调兵山': [123.545364, 42.450733],
          '开原': [124.04555, 42.54214],
          '朝阳': [120.45118, 41.57676],
          '北票': [120.76695, 41.803288],
          '凌源': [119.40479, 41.243088],
          '葫芦岛': [120.85639, 40.755573],
          '兴城': [120.72936, 40.61941],
          '长春': [125.3245, 43.88684],
          '榆树': [126.55011, 44.82764],
          '德惠': [125.70332, 44.53391],
          '吉林': [126.55302, 43.84358],
          '蛟河': [127.342735, 43.720577],
          '桦甸': [126.745445, 42.97209],
          '舒兰': [126.947815, 44.410908],
          '磐石': [126.05993, 42.942474],
          '四平': [124.37079, 43.170345],
          '公主岭': [124.81759, 43.509476],
          '双辽': [123.50528, 43.518276],
          '辽源': [125.14535, 42.90269],
          '通化': [125.9365, 41.721176],
          '梅河口': [125.68734, 42.530003],
          '集安': [126.1862, 41.126274],
          '白山': [126.42784, 41.942505],
          '临江': [126.9193, 41.810688],
          '松原': [124.82361, 45.118244],
          '扶余': [126.042755, 44.9862],
          '白城': [122.84111, 45.619026],
          '洮南': [122.783775, 45.33911],
          '大安': [124.29151, 45.50765],
          '延吉': [129.5158, 42.906963],
          '图们': [129.8467, 42.96662],
          '敦化': [128.22986, 43.36692],
          '珲春': [130.36578, 42.871056],
          '龙井': [129.42575, 42.77103],
          '和龙': [129.00874, 42.547005],
          '哈尔滨': [126.64246, 45.756966],
          '尚志': [127.96854, 45.214954],
          '五常': [127.15759, 44.91942],
          '齐齐哈尔': [123.95792, 47.34208],
          '讷河': [124.88217, 48.481133],
          '鸡西': [130.97597, 45.300045],
          '虎林': [132.97388, 45.767986],
          '密山': [131.87413, 45.54725],
          '鹤岗': [130.27748, 47.332085],
          '双鸭山': [131.1573, 46.64344],
          '大庆': [125.11272, 46.590733],
          '伊春': [128.8994, 47.724773],
          '铁力': [128.03056, 46.98577],
          '佳木斯': [130.36163, 46.809605],
          '同江': [132.51012, 47.65113],
          '富锦': [132.03795, 47.250748],
          '七台河': [131.01558, 45.771267],
          '牡丹江': [129.6186, 44.582962],
          '绥芬河': [131.16486, 44.396866],
          '海林': [129.38791, 44.57415],
          '宁安': [129.47002, 44.346836],
          '穆棱': [130.52708, 44.91967],
          '黑河': [127.49902, 50.249584],
          '北安': [126.508736, 48.245438],
          '五大连池': [126.19769, 48.512688],
          '绥化': [126.99293, 46.637394],
          '安达': [125.329926, 46.410614],
          '肇东': [125.9914, 46.06947],
          '海伦': [126.96938, 47.460426],
          '上海': [121.47264, 31.231707],
          '南京': [118.76741, 32.041546],
          '无锡': [120.30167, 31.57473],
          '江阴': [120.275894, 31.910984],
          '宜兴': [119.82054, 31.364384],
          '徐州': [117.184814, 34.26179],
          '新沂': [118.345825, 34.36878],
          '邳州': [117.96392, 34.31471],
          '常州': [119.946976, 31.772753],
          '溧阳': [119.487816, 31.42708],
          '苏州': [120.61958, 31.29938],
          '常熟': [120.74852, 31.658155],
          '张家港': [120.54344, 31.865553],
          '昆山': [120.95814, 31.381926],
          '太仓': [121.112274, 31.452568],
          '南通': [120.86461, 32.016212],
          '启东': [121.65972, 31.810158],
          '如皋': [120.56632, 32.39159],
          '海门': [121.176605, 31.893528],
          '连云港': [119.17882, 34.600018],
          '淮安': [119.02126, 33.597507],
          '盐城': [120.14, 33.377632],
          '东台': [120.3141, 32.853172],
          '扬州': [119.421005, 32.393158],
          '仪征': [119.18244, 32.271965],
          '高邮': [119.44384, 32.785164],
          '镇江': [119.45275, 32.204403],
          '丹阳': [119.58191, 31.991459],
          '扬中': [119.82806, 32.237267],
          '句容': [119.16714, 31.947355],
          '泰州': [119.91518, 32.484882],
          '兴化': [119.840164, 32.938065],
          '靖江': [120.26825, 32.01817],
          '泰兴': [120.020226, 32.168785],
          '宿迁': [118.27516, 33.96301],
          '杭州': [120.15358, 30.287458],
          '建德': [119.27909, 29.472284],
          '临安': [119.7151, 30.231153],
          '宁波': [121.54979, 29.868387],
          '余姚': [121.156296, 30.045404],
          '慈溪': [121.248055, 30.177141],
          '奉化': [121.41089, 29.662348],
          '温州': [120.67211, 28.000574],
          '瑞安': [120.64617, 27.779322],
          '乐清': [120.96715, 28.116083],
          '嘉兴': [120.75086, 30.762653],
          '海宁': [120.68882, 30.525543],
          '平湖': [121.01466, 30.698921],
          '桐乡': [120.55109, 30.629065],
          '湖州': [120.1024, 30.867199],
          '绍兴': [120.582115, 29.997116],
          '诸暨': [120.24432, 29.713661],
          '嵊州': [120.82888, 29.586605],
          '金华': [119.649506, 29.089523],
          '兰溪': [119.46052, 29.210066],
          '义乌': [120.07491, 29.306864],
          '东阳': [120.23334, 29.262547],
          '永康': [120.03633, 28.895292],
          '衢州': [118.87263, 28.941708],
          '江山': [118.62788, 28.734674],
          '舟山': [122.106865, 30.016027],
          '台州': [121.4286, 28.661379],
          '温岭': [121.37361, 28.36878],
          '临海': [121.131226, 28.845442],
          '丽水': [119.92178, 28.451994],
          '龙泉': [119.13232, 28.069178],
          '合肥': [117.28304, 31.86119],
          '巢湖': [117.87415, 31.600517],
          '芜湖': [118.37645, 31.326319],
          '蚌埠': [117.36323, 32.939667],
          '淮南': [117.018326, 32.647575],
          '马鞍山': [118.507904, 31.689362],
          '淮北': [116.79466, 33.971706],
          '铜陵': [117.816574, 30.929935],
          '安庆': [117.04355, 30.50883],
          '桐城': [116.959656, 31.050575],
          '黄山': [118.31732, 29.709238],
          '滁州': [118.31626, 32.303627],
          '天长': [119.011215, 32.6815],
          '明光': [117.99805, 32.781204],
          '阜阳': [115.81973, 32.89697],
          '界首': [115.362114, 33.26153],
          '宿州': [116.984085, 33.633892],
          '六安': [116.507675, 31.75289],
          '亳州': [115.782936, 33.86934],
          '池州': [117.48916, 30.656036],
          '宣城': [118.757996, 30.945667],
          '宁国': [118.983406, 30.62653],
          '福州': [119.30624, 26.075302],
          '福清': [119.37699, 25.720402],
          '长乐': [119.51085, 25.960583],
          '厦门': [118.11022, 24.490475],
          '莆田': [119.00756, 25.431011],
          '三明': [117.635, 26.265444],
          '永安': [117.36445, 25.974075],
          '泉州': [118.589424, 24.908854],
          '石狮': [118.6284, 24.731977],
          '晋江': [118.57734, 24.807322],
          '南安': [118.38703, 24.959494],
          '漳州': [117.661804, 24.510897],
          '龙海': [117.81729, 24.445341],
          '南平': [118.17846, 26.635628],
          '邵武': [117.49155, 27.337952],
          '武夷山': [118.0328, 27.751734],
          '建瓯': [118.32176, 27.03502],
          '龙岩': [117.02978, 25.091602],
          '漳平': [117.42073, 25.291597],
          '宁德': [119.527084, 26.65924],
          '福安': [119.650795, 27.084246],
          '福鼎': [120.219765, 27.318884],
          '南昌': [115.89215, 28.676493],
          '景德镇': [117.21466, 29.29256],
          '乐平': [117.12938, 28.967361],
          '萍乡': [113.85219, 27.622946],
          '九江': [115.99281, 29.712034],
          '瑞昌': [115.66908, 29.6766],
          '共青城': [115.80571, 29.247885],
          '新余': [114.93083, 27.810835],
          '鹰潭': [117.03384, 28.238638],
          '贵溪': [117.212105, 28.283693],
          '赣州': [114.94028, 25.85097],
          '瑞金': [116.03485, 25.875278],
          '吉安': [114.986374, 27.111698],
          '井冈山': [114.284424, 26.745918],
          '宜春': [114.391136, 27.8043],
          '丰城': [115.786, 28.191584],
          '樟树': [115.54339, 28.055899],
          '高安': [115.38153, 28.420952],
          '抚州': [116.35835, 27.98385],
          '上饶': [117.97118, 28.44442],
          '德兴': [117.578735, 28.945034],
          '济南': [117.00092, 36.675808],
          '章丘': [117.54069, 36.71209],
          '青岛': [120.35517, 36.08298],
          '胶州': [120.0062, 36.285877],
          '即墨': [120.44735, 36.390846],
          '平度': [119.959015, 36.78883],
          '莱西': [120.52622, 36.86509],
          '淄博': [118.047646, 36.814938],
          '枣庄': [117.55796, 34.856422],
          '滕州': [117.1621, 35.088497],
          '东营': [118.66471, 37.434563],
          '烟台': [121.39138, 37.539295],
          '龙口': [120.52833, 37.648445],
          '莱阳': [120.71115, 36.977036],
          '莱州': [119.94214, 37.182724],
          '蓬莱': [120.76269, 37.81117],
          '招远': [120.403145, 37.364918],
          '栖霞': [120.8341, 37.305855],
          '海阳': [121.16839, 36.78066],
          '潍坊': [119.10708, 36.70925],
          '青州': [118.484695, 36.697857],
          '诸城': [119.40318, 35.997093],
          '寿光': [118.73645, 36.874413],
          '安丘': [119.20689, 36.427418],
          '高密': [119.757034, 36.37754],
          '昌邑': [119.3945, 36.85494],
          '济宁': [116.58724, 35.415394],
          '曲阜': [116.99188, 35.59279],
          '邹城': [116.96673, 35.40526],
          '泰安': [117.12907, 36.19497],
          '新泰': [117.76609, 35.910385],
          '肥城': [116.7637, 36.1856],
          '威海': [122.116394, 37.50969],
          '荣成': [122.4229, 37.160133],
          '乳山': [121.53635, 36.91962],
          '日照': [119.461205, 35.42859],
          '莱芜': [117.677734, 36.214397],
          '临沂': [118.32645, 35.06528],
          '德州': [116.30743, 37.453968],
          '乐陵': [117.21666, 37.729115],
          '禹城': [116.642555, 36.934486],
          '聊城': [115.98037, 36.456013],
          '临清': [115.71346, 36.842598],
          '滨州': [118.016975, 37.38354],
          '菏泽': [115.46938, 35.246532],
          '郑州': [113.66541, 34.757977],
          '巩义': [112.98283, 34.75218],
          '荥阳': [113.391525, 34.789078],
          '新密': [113.380615, 34.537846],
          '新郑': [113.73967, 34.39422],
          '登封': [113.037766, 34.459938],
          '开封': [114.341446, 34.79705],
          '洛阳': [112.43447, 34.66304],
          '偃师': [112.78774, 34.72304],
          '平顶山': [113.30772, 33.73524],
          '舞钢': [113.52625, 33.302082],
          '汝州': [112.84534, 34.167408],
          '安阳': [114.352486, 36.103443],
          '林州': [113.82377, 36.063404],
          '鹤壁': [114.29544, 35.748238],
          '新乡': [113.88399, 35.302616],
          '卫辉': [114.06586, 35.404297],
          '辉县': [113.80252, 35.46132],
          '焦作': [113.238266, 35.23904],
          '沁阳': [112.93454, 35.08901],
          '孟州': [112.78708, 34.90963],
          '濮阳': [115.0413, 35.768234],
          '许昌': [113.826065, 34.022957],
          '禹州': [113.47131, 34.154404],
          '长葛': [113.76891, 34.219257],
          '漯河': [114.026405, 33.575855],
          '三门峡': [111.1941, 34.777336],
          '义马': [111.869415, 34.74687],
          '灵宝': [110.88577, 34.521263],
          '南阳': [112.54092, 32.99908],
          '邓州': [112.09271, 32.68164],
          '商丘': [115.6505, 34.437054],
          '永城': [116.44967, 33.931316],
          '信阳': [114.07503, 32.123276],
          '周口': [114.64965, 33.620358],
          '项城': [114.89952, 33.443085],
          '驻马店': [114.024734, 32.980167],
          '济源': [112.59005, 35.090378],
          '武汉': [114.29857, 30.584354],
          '黄石': [115.07705, 30.220074],
          '大冶': [114.97484, 30.098804],
          '十堰': [110.78792, 32.646908],
          '丹江口': [111.513794, 32.538837],
          '宜昌': [111.29084, 30.702637],
          '宜都': [111.45437, 30.387234],
          '当阳': [111.79342, 30.824492],
          '枝江': [111.7518, 30.425364],
          '襄阳': [112.14415, 32.042427],
          '老河口': [111.675735, 32.385437],
          '枣阳': [112.76527, 32.12308],
          '宜城': [112.261444, 31.709204],
          '鄂州': [114.890594, 30.396536],
          '荆门': [112.204254, 31.03542],
          '钟祥': [112.587265, 31.165573],
          '孝感': [113.92666, 30.926422],
          '应城': [113.573845, 30.939037],
          '安陆': [113.6904, 31.26174],
          '汉川': [113.835304, 30.652164],
          '荆州': [112.23813, 30.326857],
          '石首': [112.40887, 29.716436],
          '洪湖': [113.47031, 29.81297],
          '松滋': [111.77818, 30.176037],
          '黄冈': [114.879364, 30.447712],
          '麻城': [115.02541, 31.177906],
          '武穴': [115.56242, 29.849342],
          '咸宁': [114.328964, 29.832798],
          '赤壁': [113.88366, 29.716879],
          '随州': [113.37377, 31.717497],
          '广水': [113.8266, 31.617731],
          '恩施': [109.48676, 30.282406],
          '利川': [108.94349, 30.294247],
          '仙桃': [113.45397, 30.364952],
          '潜江': [112.896866, 30.421215],
          '天门': [113.16586, 30.65306],
          '长沙': [112.98228, 28.19409],
          '浏阳': [113.6333, 28.141111],
          '株洲': [113.15173, 27.835806],
          '醴陵': [113.50716, 27.657873],
          '湘潭': [112.94405, 27.82973],
          '湘乡': [112.525215, 27.734919],
          '韶山': [112.52848, 27.922682],
          '衡阳': [112.6077, 26.900358],
          '耒阳': [112.84721, 26.414162],
          '常宁': [112.39682, 26.406773],
          '邵阳': [111.46923, 27.237843],
          '武冈': [110.6368, 26.732086],
          '岳阳': [113.13286, 29.37029],
          '汨罗': [113.07942, 28.803148],
          '临湘': [113.450806, 29.471594],
          '常德': [111.691345, 29.040224],
          '津': [111.87961, 29.630867],
          '张家界': [110.47992, 29.127401],
          '益阳': [112.35504, 28.570066],
          '沅江': [112.36109, 28.839712],
          '郴州': [113.03207, 25.793589],
          '资兴': [113.23682, 25.974152],
          '永州': [111.60802, 26.434517],
          '怀化': [109.97824, 27.550081],
          '洪江': [109.831764, 27.201876],
          '娄底': [112.0085, 27.728136],
          '冷水江': [111.43468, 27.685759],
          '涟源': [111.670845, 27.6923],
          '吉首': [109.73827, 28.314827],
          '广州': [113.28064, 23.125177],
          '韶关': [113.591545, 24.801323],
          '乐昌': [113.35241, 25.128445],
          '南雄': [114.31123, 25.115328],
          '深圳': [114.085945, 22.547],
          '珠海': [113.553986, 22.22498],
          '汕头': [116.708466, 23.37102],
          '佛山': [113.12272, 23.028763],
          '江门': [113.09494, 22.590431],
          '台山': [112.79341, 22.250713],
          '开平': [112.69226, 22.366285],
          '鹤山': [112.96179, 22.768105],
          '恩平': [112.31405, 22.182957],
          '湛江': [110.364975, 21.274899],
          '廉江': [110.28496, 21.61128],
          '雷州': [110.08827, 20.908524],
          '吴川': [110.78051, 21.428453],
          '茂名': [110.91923, 21.659752],
          '高州': [110.85325, 21.915154],
          '化州': [110.63839, 21.654953],
          '信宜': [110.94166, 22.35268],
          '肇庆': [112.47253, 23.051546],
          '四会': [112.69503, 23.340324],
          '惠州': [114.4126, 23.079405],
          '梅州': [116.117584, 24.299112],
          '兴宁': [115.73165, 24.138077],
          '汕尾': [115.364235, 22.774485],
          '陆丰': [115.6442, 22.946104],
          '河源': [114.6978, 23.746265],
          '阳江': [111.975105, 21.859222],
          '阳春': [111.7905, 22.169598],
          '清远': [113.05122, 23.685022],
          '英德': [113.4054, 24.18612],
          '连州': [112.37927, 24.783966],
          '东莞': [113.74626, 23.046238],
          '中山': [113.38239, 22.521112],
          '潮州': [116.6323, 23.661701],
          '揭阳': [116.355736, 23.543777],
          '普宁': [116.165085, 23.29788],
          '云浮': [112.04444, 22.929802],
          '罗定': [111.5782, 22.765415],
          '南宁': [108.32001, 22.82402],
          '柳州': [109.411705, 24.314617],
          '桂林': [110.29912, 25.274216],
          '梧州': [111.29761, 23.474804],
          '岑溪': [110.998116, 22.918406],
          '北海': [109.119255, 21.473343],
          '防城港': [108.345474, 21.614632],
          '东兴': [107.97017, 21.541172],
          '钦州': [108.624176, 21.967127],
          '贵港': [109.60214, 23.0936],
          '桂平': [110.07467, 23.382473],
          '玉林': [110.154396, 22.63136],
          '北流': [110.34805, 22.701649],
          '百色': [106.61629, 23.897741],
          '靖西': [23.134766, 106.41755],
          '贺州': [111.552055, 24.41414],
          '河池': [108.0621, 24.695898],
          '宜州': [108.65397, 24.492193],
          '来宾': [109.229774, 23.733767],
          '合山': [108.88858, 23.81311],
          '崇左': [107.35393, 22.404108],
          '凭祥': [106.75904, 22.108883],
          '海口': [110.33119, 20.031971],
          '三亚': [109.50827, 18.247871],
          '三沙': [112.34882, 16.83104],
          '儋州': [19.517487, 109.57678],
          '五指山': [109.51666, 18.77692],
          '琼海': [110.46678, 19.246012],
          '文昌': [110.753975, 19.612986],
          '万宁': [110.388794, 18.796215],
          '东方': [108.653786, 19.10198],
          '重庆': [106.50496, 29.533155],
          '成都': [104.065735, 30.659462],
          '都江堰': [103.6279, 30.99114],
          '彭州': [103.94117, 30.98516],
          '邛崃': [103.46143, 30.41327],
          '崇州': [103.67105, 30.631477],
          '自贡': [104.773445, 29.352764],
          '攀枝花': [101.716, 26.580446],
          '泸州': [105.44335, 28.889137],
          '德阳': [104.39865, 31.12799],
          '广汉': [104.281906, 30.97715],
          '什邡': [104.17365, 31.12688],
          '绵竹': [104.200165, 31.343084],
          '绵阳': [104.74172, 31.46402],
          '江油': [104.74443, 31.776386],
          '广元': [105.82976, 32.433666],
          '遂宁': [105.57133, 30.513311],
          '内江': [105.06614, 29.58708],
          '乐山': [103.76126, 29.582024],
          '峨眉山': [103.492485, 29.597479],
          '南充': [106.08298, 30.79528],
          '阆中': [105.975266, 31.580465],
          '眉山': [103.83179, 30.048319],
          '宜宾': [104.63082, 28.76019],
          '广安': [106.63337, 30.456398],
          '华蓥': [106.777885, 30.380573],
          '达州': [107.50226, 31.209484],
          '万源': [108.037544, 32.06777],
          '雅安': [103.00103, 29.987722],
          '巴中': [106.75367, 31.858809],
          '资阳': [104.641914, 30.122211],
          '康定': [30.050737, 101.96406],
          '西昌': [102.25876, 27.885786],
          '贵阳': [106.71348, 26.578342],
          '清镇': [106.470276, 26.551289],
          '六盘水': [104.84674, 26.584642],
          '遵义': [106.93726, 27.706627],
          '赤水': [105.69811, 28.587057],
          '仁怀': [106.412476, 27.803377],
          '安顺': [105.93219, 26.245544],
          '毕节': [105.28501, 27.301693],
          '铜仁': [109.19155, 27.718346],
          '兴义': [104.89798, 25.088598],
          '凯里': [107.97754, 26.582964],
          '都匀': [107.51702, 26.258205],
          '福泉': [107.51351, 26.702509],
          '昆明': [102.71225, 25.04061],
          '安宁': [102.48554, 24.921785],
          '曲靖': [103.79785, 25.501556],
          '宣威': [104.09554, 26.227777],
          '玉溪': [102.54391, 24.35046],
          '保山': [99.16713, 25.111801],
          '腾冲': [25.01757, 98.49729],
          '昭通': [103.71722, 27.337],
          '丽江': [100.233025, 26.872108],
          '普洱': [100.97234, 22.77732],
          '临沧': [100.08697, 23.886566],
          '楚雄': [101.54614, 25.040913],
          '个旧': [103.154755, 23.360382],
          '开远': [103.25868, 23.713833],
          '蒙自': [103.385, 23.366842],
          '弥勒': [103.43699, 24.40837],
          '文山': [104.24428, 23.369217],
          '景洪': [100.79795, 22.002087],
          '大理': [100.24137, 25.593067],
          '瑞丽': [97.85588, 24.010735],
          '芒': [98.57761, 24.436699],
          '香格里拉': [99.708664, 27.825804],
          '拉萨': [91.13221, 29.66036],
          '日喀则': [88.88515, 29.267519],
          '昌都': [97.17845, 31.136875],
          '林芝': [29.654694, 94.36235],
          '西安': [108.94802, 34.26316],
          '铜川': [108.97961, 34.91658],
          '宝鸡': [107.14487, 34.369316],
          '咸阳': [108.70512, 34.33344],
          '兴平': [108.488495, 34.297134],
          '渭南': [109.502884, 34.499382],
          '韩城': [110.45239, 35.47524],
          '华阴': [110.08952, 34.565357],
          '延安': [109.49081, 36.59654],
          '汉中': [107.02862, 33.077667],
          '榆林': [109.741196, 38.29016],
          '安康': [109.029274, 32.6903],
          '商洛': [109.93977, 33.86832],
          '兰州': [103.823555, 36.05804],
          '嘉峪关': [98.277306, 39.78653],
          '金昌': [102.18789, 38.514236],
          '白银': [104.17361, 36.54568],
          '天水': [105.725, 34.57853],
          '武威': [102.6347, 37.929996],
          '张掖': [100.455475, 38.932896],
          '平凉': [106.68469, 35.54279],
          '酒泉': [98.510796, 39.744022],
          '玉门': [97.03721, 40.28682],
          '敦煌': [94.664276, 40.141117],
          '庆阳': [107.638374, 35.73422],
          '定西': [104.6263, 35.57958],
          '陇南': [104.92938, 33.3886],
          '临夏': [103.21163, 35.59941],
          '合作': [102.91149, 34.985973],
          '西宁': [101.778915, 36.623177],
          '海东': [102.10327, 36.502914],
          '玉树': [97.00876, 33.00393],
          '格尔木': [94.90578, 36.401543],
          '德令哈': [97.37014, 37.374554],
          '银川': [106.278175, 38.46637],
          '灵武': [106.3347, 38.09406],
          '石嘴山': [106.376175, 39.01333],
          '吴忠': [106.19941, 37.986164],
          '青铜峡': [106.07539, 38.021507],
          '固原': [106.28524, 36.004562],
          '中卫': [105.18957, 37.51495],
          '乌鲁木齐': [87.61773, 43.792816],
          '克拉玛依': [84.87395, 45.595886],
          '吐鲁番': [42.947613, 89.184074],
          '昌吉': [87.304115, 44.013184],
          '阜康': [87.98384, 44.152153],
          '博乐': [82.072235, 44.903088],
          '阿拉山口': [82.56939, 45.16777],
          '库尔勒': [86.14595, 41.763123],
          '阿克苏': [80.2629, 41.171272],
          '阿图什': [76.17394, 39.7129],
          '喀什': [75.98838, 39.46786],
          '和田': [79.92754, 37.108944],
          '伊宁': [81.316345, 43.92221],
          '奎屯': [84.9016, 44.423447],
          '霍尔果斯': [80.42076, 44.201668],
          '塔城': [82.983986, 46.74628],
          '乌苏': [84.67763, 44.430115],
          '阿勒泰': [88.13874, 47.84891],
          '石河子': [86.04108, 44.305885],
          '阿拉尔': [81.28588, 40.541916],
          '图木舒克': [79.07798, 39.867317],
          '五家渠': [87.526886, 44.1674],
          '铁门关': [85.50122, 41.82725]
        };
        const convertData = function (data) {
          var res = [];
          for (var i = 0; i < data.length; i++) {
            var geoCoord = geoCoordMap[data[i].name];
            if (geoCoord) {
              res.push({
                name: data[i].name,
                value: geoCoord.concat(data[i].value)
              });
            }
          }
          return res;
        };
        var option = {
          title: {
            text: `${this.brandName} 全国销量分析`,
            left: 'center'
          },
          tooltip: {
            trigger: 'item'
          },
          bmap: {
            center: [104.114129, 37.550339],
            zoom: 5,
            roam: true,
            mapStyle: {
              styleJson: [
                {
                  featureType: 'water',
                  elementType: 'all',
                  stylers: {
                    color: '#d1d1d1'
                  }
                },
                {
                  featureType: 'land',
                  elementType: 'all',
                  stylers: {
                    color: '#f3f3f3'
                  }
                },
                {
                  featureType: 'railway',
                  elementType: 'all',
                  stylers: {
                    visibility: 'off'
                  }
                },
                {
                  featureType: 'highway',
                  elementType: 'all',
                  stylers: {
                    color: '#fdfdfd'
                  }
                },
                {
                  featureType: 'highway',
                  elementType: 'labels',
                  stylers: {
                    visibility: 'off'
                  }
                },
                {
                  featureType: 'arterial',
                  elementType: 'geometry',
                  stylers: {
                    color: '#fefefe'
                  }
                },
                {
                  featureType: 'arterial',
                  elementType: 'geometry.fill',
                  stylers: {
                    color: '#fefefe'
                  }
                },
                {
                  featureType: 'poi',
                  elementType: 'all',
                  stylers: {
                    visibility: 'off'
                  }
                },
                {
                  featureType: 'green',
                  elementType: 'all',
                  stylers: {
                    visibility: 'off'
                  }
                },
                {
                  featureType: 'subway',
                  elementType: 'all',
                  stylers: {
                    visibility: 'off'
                  }
                },
                {
                  featureType: 'manmade',
                  elementType: 'all',
                  stylers: {
                    color: '#d1d1d1'
                  }
                },
                {
                  featureType: 'local',
                  elementType: 'all',
                  stylers: {
                    color: '#d1d1d1'
                  }
                },
                {
                  featureType: 'arterial',
                  elementType: 'labels',
                  stylers: {
                    visibility: 'off'
                  }
                },
                {
                  featureType: 'boundary',
                  elementType: 'all',
                  stylers: {
                    color: '#fefefe'
                  }
                },
                {
                  featureType: 'building',
                  elementType: 'all',
                  stylers: {
                    color: '#d1d1d1'
                  }
                },
                {
                  featureType: 'label',
                  elementType: 'labels.text.fill',
                  stylers: {
                    color: '#999999'
                  }
                }
              ]
            }
          },
          series: [
            {
              name: '销量',
              type: 'scatter',
              coordinateSystem: 'bmap',
              data: convertData(data),
              symbolSize: function (val) {
                return val[2] / 50;
              },
              encode: {
                value: 2
              },
              label: {
                formatter: '{b}',
                position: 'right',
                show: false
              },
              emphasis: {
                label: {
                  show: true
                }
              }
            },
          ]
        };

        myChart.setOption(option);
        this.fullscreenLoading = false
      })
    }
  }

}
</script>

<style scoped lang="scss">
.container {
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
}

.chart {
  width: 100%;
  height: 90%;
  min-height: 300px; /* 设置最小高度，避免图表内容过少时显示不全 */
}
</style>
